package com.fc.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fc.user.Gender;

/**
 * 
 * @author Ács Ádám
 *
 */
@Entity
@Table(name = "User", catalog="fc")
public class User extends CommonEntity {
	@Id
	@Column(name = "username", unique = true, nullable = false)
	private String userName;
	
	@Column(name = "password", unique = false, nullable = false)
	private String password;

	@Column(name = "weight", unique = false, nullable = false)
	private int weight;
	
	@Column(name = "height", unique = false, nullable = false)
	private int height;
	
	@Column(name = "realname", unique = false, nullable = true)
	private String realName;
	
	@Column(name = "enabled", unique = false, nullable = false)
	private boolean enabled;
	
	@Column(name = "gender", columnDefinition = "enum('MALE', 'FEMALE')")
	@Enumerated(EnumType.STRING)
	private Gender gender;
	
	@Column(name = "age", unique = false, nullable = true)
	private int age;
	
	public User() {
		super();
	}
	 
	public User(String userName, String password, int weight, int height, String realName, Gender gender, int age, boolean enabled) {
		super();
		this.userName = userName;
		this.password = password;
		this.weight = weight;
		this.height = height;
		this.realName = realName;
		this.gender = gender;
		this.age = age;
		this.enabled = enabled;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	@Override
	public String toString() {
		return userName;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
}